@echo off
set "p=%~p0"
for %%a in (%p:\= %) do set app=%%a

for /f %%i in ('git rev-list HEAD --count') do set COUNT=%%i
for /f %%i in ('git rev-parse --short HEAD') do set HEAD=%%i
set version=v%count%-%head%
set namespace=gomro-galaxy
echo -----------------------------------------------------------------------------
echo  %namespace% : %app% : %version%
echo -----------------------------------------------------------------------------
echo on

docker build --build-arg JAR_FILE=target/*.jar --build-arg APP_VERSION=%version% -t registry.cn-hangzhou.aliyuncs.com/%namespace%/%app%:latest .
docker push registry.cn-hangzhou.aliyuncs.com/%namespace%/%app%:latest
docker tag registry.cn-hangzhou.aliyuncs.com/%namespace%/%app% registry.cn-hangzhou.aliyuncs.com/%namespace%/%app%:%version%
docker push registry.cn-hangzhou.aliyuncs.com/%namespace%/%app%:%version%


